var pstation;

function threeStart() {
    var initOption = {
        antialias: true,
        showHelpGrid: true,
        clearCoolr: 0x4e72b8
    };
    pstation = new p3D();
    var Aobjects = {
        objects: [
            //地板
            {
                show: true,
                uuid: "",
                name: 'floor',
                objType: 'floor',
                length: 2000,
                width: 1600,
                height: 10,
                rotation: [{ direction: 'x', degree: 0 }],//旋转 表示x方向0度  arb表示任意参数值[x,y,z,angle]
                x: 0,
                y: 0,
                z: 0,
                style: {
                    skinColor: 0x8ac9e2,
                    skin: {
                        skin_up: {
                            skinColor: 0x98750f,
                            imgurl: "./mng/floor.jpg",
                            repeatx: true,
                            repeaty: true,
                            width: 128,
                            height: 128
                        },
                        skin_down: {
                            skinColor: 0x8ac9e2,
                        },
                        skin_fore: {
                            skinColor: 0x8ac9e2,
                        }
                    }
                }
            },
            //墙体
            {
                show: true,
                uuid: "",
                name: 'wall',
                objType: 'wall',
                thick: 20,
                length: 100,
                height: 240,
                wallData: [
                     {//wall1 bottom
                         uuid: "",
                         name: 'wall1',
                         thick: 20,
                         height: 240,
                         skin: {
                             skin_up: {
                                 skinColor: 0xdddddd,
                             },
                             skin_down: {
                                 skinColor: 0xdddddd,
                             },
                             skin_fore: {
                                 skinColor: 0xb0cee0,
                             },
                             skin_behind: {
                                 skinColor: 0xb0cee0,
                             },
                             skin_left: {
                                 skinColor: 0xdeeeee,
                             },
                             skin_right: {
                                 skinColor: 0xb0cee0,
                             }
                         },
                         startDot: {
                             x: -700,
                             y: 120,
                             z: -600
                         },
                         endDot: {
                             x: 600,
                             y: 120,
                             z: -600
                         },
                         rotation: [{ direction: 'x', degree: 0 }],//旋转 表示x方向0度  arb表示任意参数值[x,y,z,angle]
                         childrens: [
                              {
                                  op: '-',
                                  show: true,
                                  uuid: "",
                                  name: 'doorhole',
                                  objType: 'doorhole',
                                  thick: 20,
                                  height: 220,
                                  startDot: {
                                      x: -610,
                                      y: 110,
                                      z: -600
                                  },
                                  endDot: {
                                      x: -390,
                                      y: 110,
                                      z: -600
                                  },
                                  skin: {
                                      skin_up: {
                                          skinColor: 0xffdddd,
                                      },
                                      skin_down: {
                                          skinColor: 0xdddddd,
                                      },
                                      skin_fore: {
                                          skinColor: 0xffdddd,
                                      },
                                      skin_behind: {
                                          skinColor: 0xffdddd,
                                      },
                                      skin_left: {
                                          skinColor: 0xffdddd,
                                      },
                                      skin_right: {
                                          skinColor: 0xffdddd,
                                      }
                                  },
                              },
                                 {
                                     op: '-',
                                     show: true,
                                     uuid: "",
                                     name: 'windowHole',
                                     objType: 'windowHole',
                                     thick: 20,
                                     height: 160,
                                     startDot: {
                                         x: -250,
                                         y: 130,
                                         z: -600
                                     },
                                     endDot: {
                                         x: 450,
                                         y: 130,
                                         z: -600
                                     }
                                 },
                                {
                                    show: true,
                                    name: 'windowCaseBottom',
                                    uuid: "",
                                    objType: 'cube',
                                    thick: 30,
                                    height: 10,
                                    startDot: {
                                        x: -250,
                                        y: 50,
                                        z: -600
                                    },
                                    endDot: {
                                        x: 450,
                                        y: 50,
                                        z: -600
                                    },
                                    skin: {
                                        skin_up: {
                                            skinColor: 0xc0dee0,
                                        },
                                        skin_down: {
                                            skinColor: 0xc0dee0,
                                        },
                                        skin_fore: {
                                            skinColor: 0xc0dee0,
                                        },
                                        skin_behind: {
                                            skinColor: 0xc0dee0,
                                        },
                                        skin_left: {
                                            skinColor: 0xd0eef0,
                                        },
                                        skin_right: {
                                            skinColor: 0xd0eef0,
                                        }
                                    },
                                },

                              {
                                  show: true,
                                  uuid: "",
                                  name: 'doorCaseRight',
                                  objType: 'cube',
                                  thick: 24,
                                  height: 220,
                                  startDot: {
                                      x: -610,
                                      y: 110,
                                      z: -600
                                  },
                                  endDot: {
                                      x: -605,
                                      y: 110,
                                      z: -600
                                  },
                                  skin: {
                                      skin_up: {
                                          skinColor: 0xc0dee0,
                                      },
                                      skin_down: {
                                          skinColor: 0xc0dee0,
                                      },
                                      skin_fore: {
                                          skinColor: 0xc0dee0,
                                      },
                                      skin_behind: {
                                          skinColor: 0xc0dee0,
                                      },
                                      skin_left: {
                                          skinColor: 0xd0eef0,
                                      },
                                      skin_right: {
                                          skinColor: 0xd0eef0,
                                      }
                                  },
                              },
                              {
                                  show: true,
                                  name: 'doorCaseLeft',
                                  uuid: "",
                                  objType: 'cube',
                                  thick: 24,
                                  height: 220,
                                  startDot: {
                                      x: -390,
                                      y: 110,
                                      z: -600
                                  },
                                  endDot: {
                                      x: -395,
                                      y: 110,
                                      z: -600
                                  },
                                  skin: {
                                      skin_up: {
                                          skinColor: 0xc0dee0,
                                      },
                                      skin_down: {
                                          skinColor: 0xc0dee0,
                                      },
                                      skin_fore: {
                                          skinColor: 0xc0dee0,
                                      },
                                      skin_behind: {
                                          skinColor: 0xc0dee0,
                                      },
                                      skin_left: {
                                          skinColor: 0xd0eef0,
                                      },
                                      skin_right: {
                                          skinColor: 0xd0eef0,
                                      }
                                  },
                              },
                              {
                                  show: true,
                                  name: 'doorCaseTop',
                                  uuid: "",
                                  objType: 'cube',
                                  thick: 24,
                                  height: 5,
                                  startDot: {
                                      x: -390,
                                      y: 220,
                                      z: -600
                                  },
                                  endDot: {
                                      x: -610,
                                      y: 220,
                                      z: -600
                                  },
                                  skin: {
                                      skin_up: {
                                          skinColor: 0xc0dee0,
                                      },
                                      skin_down: {
                                          skinColor: 0xc0dee0,
                                      },
                                      skin_fore: {
                                          skinColor: 0xc0dee0,
                                      },
                                      skin_behind: {
                                          skinColor: 0xc0dee0,
                                      },
                                      skin_left: {
                                          skinColor: 0xd0eef0,
                                      },
                                      skin_right: {
                                          skinColor: 0xd0eef0,
                                      }
                                  },
                              },
                              {
                                  show: true,
                                  name: 'doorCaseBottom',
                                  uuid: "",
                                  objType: 'cube',
                                  thick: 24,
                                  height: 5,
                                  startDot: {
                                      x: -390,
                                      y: 5,
                                      z: -600
                                  },
                                  endDot: {
                                      x: -610,
                                      y: 5,
                                      z: -600
                                  },
                                  skin: {
                                      skin_up: {
                                          skinColor: 0xc0dee0,
                                      },
                                      skin_down: {
                                          skinColor: 0xc0dee0,
                                      },
                                      skin_fore: {
                                          skinColor: 0xc0dee0,
                                      },
                                      skin_behind: {
                                          skinColor: 0xc0dee0,
                                      },
                                      skin_left: {
                                          skinColor: 0xd0eef0,
                                      },
                                      skin_right: {
                                          skinColor: 0xd0eef0,
                                      }
                                  },
                              },
                              {
                                  show: true,
                                  name: 'doorLeft',
                                  uuid: "",
                                  objType: 'cube',
                                  thick: 4,
                                  height: 210,
                                  startDot: {
                                      x: -396,
                                      y: 112,
                                      z: -600
                                  },
                                  endDot: {
                                      x: -500,
                                      y: 112,
                                      z: -600
                                  },
                                  skin: {
                                      opacity: 0.1,
                                      skin_up: {
                                          skinColor: 0x51443e,
                                      },
                                      skin_down: {
                                          skinColor: 0x51443e,
                                      },
                                      skin_fore: {
                                          skinColor: 0x51443e,
                                      },
                                      skin_behind: {
                                          skinColor: 0x51443e,
                                      },
                                      skin_left: {
                                          skinColor: 0x51443e,
                                          imgurl: "./mng/door_left.png",
                                      },
                                      skin_right: {
                                          skinColor: 0x51443e,
                                          imgurl: "./mng/door_right.png",
                                      }
                                  },
                              },
                              {
                                  show: true,
                                  name: 'doorRight',
                                  uuid: "",
                                  objType: 'cube',
                                  thick: 4,
                                  height: 210,
                                  startDot: {
                                      x: -500,
                                      y: 112,
                                      z: -600
                                  },
                                  endDot: {
                                      x: -604,
                                      y: 112,
                                      z: -600
                                  },
                                  skin: {
                                      opacity: 0.1,
                                      skin_up: {
                                          skinColor: 0x51443e,
                                      },
                                      skin_down: {
                                          skinColor: 0x51443e,
                                      },
                                      skin_fore: {
                                          skinColor: 0x51443e,
                                      },
                                      skin_behind: {
                                          skinColor: 0x51443e,
                                      },
                                      skin_left: {
                                          skinColor: 0x51443e,
                                          imgurl: "./mng/door_right.png",
                                      },
                                      skin_right: {
                                          skinColor: 0x51443e,
                                          imgurl: "./mng/door_left.png",
                                      }
                                  },
                              },
                               {
                                   show: true,
                                   name: 'doorControl',
                                   uuid: "",
                                   objType: 'cube',
                                   thick: 10,
                                   height: 40,
                                   startDot: {
                                       x: -320,
                                       y: 160,
                                       z: -615
                                   },
                                   endDot: {
                                       x: -360,
                                       y: 160,
                                       z: -615
                                   },
                                   skin: {
                                       opacity: 0.1,
                                       skin_up: {
                                           skinColor: 0x333333,
                                       },
                                       skin_down: {
                                           skinColor: 0x333333,
                                       },
                                       skin_fore: {
                                           skinColor: 0x333333,
                                       },
                                       skin_behind: {
                                           skinColor: 0x333333,
                                       },
                                       skin_left: {
                                           skinColor: 0x333333,
                                           imgurl: "./mng/doorControl.jpg",
                                       },
                                       skin_right: {
                                           skinColor: 0x333333,
                                       }
                                   },
                               },
                         ]
                     },
                     {//wall2 top
                         uuid: "",
                         name: 'wall2',
                         thick: 20,
                         height: 240,
                         skin: {
                             skin_up: {
                                 skinColor: 0xdddddd,
                             },
                             skin_down: {
                                 skinColor: 0xdddddd,
                             },
                             skin_fore: {
                                 skinColor: 0xb0cee0,
                             },
                             skin_behind: {
                                 skinColor: 0xb0cee0,
                             },
                             skin_left: {
                                 skinColor: 0xb0cee0,
                             },
                             skin_right: {
                                 skinColor: 0xdeeeee,
                             }
                         },
                         startDot: {
                             x: -700,
                             y: 120,
                             z: 380
                         },
                         endDot: {
                             x: 50,
                             y: 120,
                             z: 380
                         },
                     },
                     {//wall2 top 2
                         uuid: "",
                         name: 'wall24',
                         thick: 20,
                         height: 240,
                         skin: {
                             skin_up: {
                                 skinColor: 0xdddddd,
                             },
                             skin_down: {
                                 skinColor: 0xdddddd,
                             },
                             skin_fore: {
                                 skinColor: 0xb0cee0,
                             },
                             skin_behind: {
                                 skinColor: 0xb0cee0,
                             },
                             skin_left: {
                                 skinColor: 0xb0cee0,
                             },
                             skin_right: {
                                 skinColor: 0xdeeeee,
                             }
                         },
                         startDot: {
                             x: 60,
                             y: 120,
                             z: 655
                         },
                         endDot: {
                             x: 600,
                             y: 120,
                             z: 655
                         },
                     },
                     {//wall3  left
                         uuid: "",
                         name: 'wall3',
                         thick: 20,
                         height: 240,
                         skin: {
                             skin_up: {
                                 skinColor: 0xdddddd,
                             },
                             skin_down: {
                                 skinColor: 0xdddddd,
                             },
                             skin_fore: {
                                 skinColor: 0xb0cee0,
                             },
                             skin_behind: {
                                 skinColor: 0xdeeeee,
                             },
                             skin_left: {
                                 skinColor: 0xb0cee0,
                             },
                             skin_right: {
                                 skinColor: 0xb0cee0,
                             }
                         },
                         startDot: {
                             x: 600,
                             y: 120,
                             z: -610
                         },
                         endDot: {
                             x: 600,
                             y: 120,
                             z: 655
                         },
                     },
                     {//wall3  left 2
                         uuid: "",
                         name: 'wall32',
                         thick: 20,
                         height: 240,
                         skin: {
                             skin_up: {
                                 skinColor: 0xdddddd,
                             },
                             skin_down: {
                                 skinColor: 0xdddddd,
                             },
                             skin_fore: {
                                 skinColor: 0xb0cee0,
                             },
                             skin_behind: {
                                 skinColor: 0xdeeeee,
                             },
                             skin_left: {
                                 skinColor: 0xb0cee0,
                             },
                             skin_right: {
                                 skinColor: 0xb0cee0,
                             }
                         },
                         startDot: {
                             x: 60,
                             y: 120,
                             z: 370
                         },
                         endDot: {
                             x: 60,
                             y: 120,
                             z: 655
                         },
                     },
                     {//wall4 right
                         uuid: "",
                         name: 'wall4',
                         thick: 20,
                         height: 240,
                         skin: {
                             skin_up: {
                                 skinColor: 0xdddddd,
                             },
                             skin_down: {
                                 skinColor: 0xdddddd,
                             },
                             skin_fore: {
                                 skinColor: 0xdeeeee,
                             },
                             skin_behind: {
                                 skinColor: 0xb0cee0,
                             },
                             skin_left: {
                                 skinColor: 0xb0cee0,
                             },
                             skin_right: {
                                 skinColor: 0xb0cee0,
                             }
                         },
                         startDot: {
                             x: -700,
                             y: 120,
                             z: -610
                         },
                         endDot: {
                             x: -700,
                             y: 120,
                             z: 380
                         },
                     },
                     {//wall5
                         uuid: "",
                         name: 'wall5',
                         thick: 20,
                         height: 240,
                         skin: {
                             skin_up: {
                                 skinColor: 0xdddddd,
                             },
                             skin_down: {
                                 skinColor: 0xdddddd,
                             },
                             skin_fore: {
                                 skinColor: 0xdeeeee,
                             },
                             skin_behind: {
                                 skinColor: 0xb0cee0,
                             },
                             skin_left: {
                                 skinColor: 0xb0cee0,
                             },
                             skin_right: {
                                 skinColor: 0xb0cee0,
                             }
                         },
                         startDot: {
                             x: -990,
                             y: 120,
                             z: -800
                         },
                         endDot: {
                             x: -990,
                             y: 120,
                             z: 800
                         },
						 childrens: [
							 {
                                     op: '-',
                                     show: true,
                                     uuid: "",
                                     name: 'windowHole',
                                     objType: 'windowHole',
                                     thick: 20,
                                     height: 160,
                                     startDot: {
                                         x: -990,
                                         y: 130,
                                         z: -750
                                     },
                                     endDot: {
                                         x: -990,
                                         y: 130,
                                         z: 750
                                     }
                                 }
							]
                     },
                     {//wall6
                         uuid: "",
                         name: 'wall6',
                         thick: 20,
                         height: 240,
                         skin: {
                             skin_up: {
                                 skinColor: 0xdddddd,
                             },
                             skin_down: {
                                 skinColor: 0xdddddd,
                             },
                             skin_fore: {
                                 skinColor: 0xdeeeee,
                             },
                             skin_behind: {
                                 skinColor: 0xb0cee0,
                             },
                             skin_left: {
                                 skinColor: 0xb0cee0,
                             },
                             skin_right: {
                                 skinColor: 0xb0cee0,
                             }
                         },
                         startDot: {
                             x: 990,
                             y: 120,
                             z: -800
                         },
                         endDot: {
                             x: 990,
                             y: 120,
                             z: 800
                         },
						 childrens: [
							 {
                                     op: '-',
                                     show: true,
                                     uuid: "",
                                     name: 'windowHole',
                                     objType: 'windowHole',
                                     thick: 20,
                                     height: 160,
                                     startDot: {
                                         x: 990,
                                         y: 130,
                                         z: -750
                                     },
                                     endDot: {
                                         x: 990,
                                         y: 130,
                                         z: 750
                                     }
                                 }
							]
                     }
                ],
                style: {
                    skinColor: 0x8ac9e2
                }

            },
            //玻璃1
            {
                show: true,
                name: 'windowGlass1',
                uuid: "",
                objType: 'glasses',
                width: 700,
                height: 160,
                pic: "./mng/glass.png",
                transparent: true,
                opacity: 1,
                position: { x: 100, y: 130, z: -600 },
                rotation: { x: 0, y: 0 * Math.PI, z: 0 },
                blending: false,
            },
			//玻璃2
            {
                show: true,
                name: 'windowGlass2',
                uuid: "",
                objType: 'glasses',
                width: 1500,
                height: 160,
                pic: "./mng/glass.png",
                transparent: true,
                opacity: 1,
                position: { x: -990, y: 130, z: 0 },
                rotation: { x: 0, y: 0.5 * Math.PI, z: 0 },
                blending: false,
            },
			//玻璃3
            {
                show: true,
                name: 'windowGlass3',
                uuid: "",
                objType: 'glasses',
                width: 1500,
                height: 160,
                pic: "./mng/glass.png",
                transparent: true,
                opacity: 1,
                position: { x: 990, y: 130, z: 0 },
                rotation: { x: 0, y: 0.5 * Math.PI, z: 0 },
                blending: false,
            },
            //贴海报
            {
                show: true,
                name: 'messagePanel',
                uuid: "",
                objType: 'plane',
                width: 100,
                height: 160,
                pic: "./mng/message.jpg",
                transparent: true,
                opacity: 1,
                position: { x:-400, y: 150, z: 365 },
                rotation: { x: 0, y: Math.PI, z: 0 },
                blending: false,
            },
            //空调
             {
                 show: true,
                 uuid: "",
                 name: 'aircondition',
                 objType: 'cube',
                 length: 60,
                 width: 80,
                 height: 220,
                 rotation: [{ direction: 'y', degree: 0.3*Math.PI}],//旋转 表示x方向0度  arb表示任意参数值[x,y,z,angle]
                 x: -630,
                 y: 110,
                 z: 300,
                 style: {
                     skinColor: 0xfefefe,
                     skin: {
                         skin_fore: {
                             imgurl: "./mng/aircondition.jpg",
                         },
                     }
                 }
             },
			 //chair
             {
                 show: true,
                 uuid: "",
                 name: 'chair',
                 objType: 'cube',
                 length: 80,
                 width: 380,
                 height: 60,
                 x: 750,
                 y: 30,
                 z: 250,
                 style: {
                     skinColor: 0xf0fef0,
                 }
             },
			//chair2
             {
                 show: true,
                 uuid: "",
                 name: 'chair2',
                 objType: 'cube',
                 length: 160,
                 width: 120,
                 height: 60,
                 x: -350,
                 y: 30,
                 z: 580,
                 style: {
                     skinColor: 0xf0fef0,
                 }
             },
			 //camera001
             {
                 show: true,
                 uuid: "",
                 name: 'camera001',
                 objType: 'loadobj',
				 position:{x:-130,y:240,z:360},
				 size:{x:1,y:1,z:1},
				 rotation: { x:0,y:0,z:0},
				 modelurl: './mng/model.json',
             },
             //电视机
             {
                 show: true,
                 uuid: "",
                 name: 'television',
                 objType: 'cube',
                 length: 10,
                 width: 180,
                 height: 120,
                 rotation: [{ direction: 'x', degree:0}],//旋转 表示x方向0度  arb表示任意参数值[x,y,z,angle]
                 x: -680,
                 y: 150,
                 z: -150,
                 style: {
                     skinColor: 0x555555,
                     skin: {
                         skin_fore: {
                             imgurl: "./mng/tv.jpg",
                         },
                     }
                 }
             },
            //机柜1-1 --原型
            {
                show:true,
                name: 'cabinet1_1',
                shellname:'cabinet1_1_shell',
                uuid: '',
               // rotation: [{ direction: 'y', degree: 0.25*Math.PI}],//旋转     uuid:'',
                objType: 'emptyCabinet',
                transparent:true,
                size:{length:66,width:70,height:200, thick:2},
                position: { x:450, y: 105, z: -430 },
                doors: {
                    doorType:'lr',// ud上下门 lr左右门 单门可以缺省
                    doorSize: [1],
                    doorname: ['cabinet1_1_door_01'],
                    skins:[ {
                        skinColor: 0x333333,
                        skin_fore: {
                            imgurl: "./mng/rack_door_back.jpg",
                        },
                        skin_behind: {
                            imgurl: "./mng/rack_front_door.jpg",
                        }
                    }]
                },
                skin:{
                    skinColor: 0xff0000,
                    skin_up: {
                        skin:{
                            skinColor: 0xff0000,
                            skin_up: { imgurl: "./mng/rack_door_back.jpg" },
                            skin_down: { imgurl: "./mng/rack_door_back.jpg" },
                            skin_fore: {
                                skinColor: 0xff0000,
                                imgurl: "./mng/rack_door_back.jpg"
                            },
                            skin_behind: {
                                skinColor: 0xff0000,
                                imgurl: "./mng/rack_door_back.jpg"
                            },
                            skin_left: { imgurl: "./mng/rack_door_back.jpg" },
                            skin_right: { imgurl: "./mng/rack_door_back.jpg" },
                        }
                    },
                    skin_down: {
                        skin: {
                            skinColor: 0x333333,
                        }
                    },
                    skin_left: {
                        skin: {
                            skinColor: 0x333333,
                        }
                    },
                    skin_right: {
                        skin: {
                            skinColor: 0x333333,
                        }
                    },
                    skin_behind: {
                        skin: {
                            skinColor: 0x333333,
                        }
                    }
                }
            },
            //主机11
              {
                  show: true,
                  uuid: "",
                  name: 'equipment_card_11',
                  objType: 'cube',
                  length: 60,
                  width: 65,
                  height: 20,
                  x: -150,
                  y: 80,
                  z: -430,
                  style: {
                      skinColor: 0x92630b,
                      skin: {
                          skin_up: {
                              skinColor: 0x92630b,
                              imgurl: "./mng/rack_inside.jpg",
                          },
                          skin_down: {
                              skinColor: 0x92630b,
                              imgurl: "./mng/rack_inside.jpg",
                          },
                          skin_fore: {
                              skinColor: 0x92630b,
                              imgurl: "./mng/rack_inside.jpg",
                          },
                          skin_behind: {
                              skinColor: 0x92630b,
                              imgurl: "./mng/server2.jpg",
                          },
                          skin_left: {
                              skinColor: 0x92630b,
                              imgurl: "./mng/rack_inside.jpg",
                          },
                          skin_right: {
                              skinColor: 0x92630b,
                              imgurl: "./mng/rack_inside.jpg",
                          }
                      }
                  }
              },
            //主机21
              {
                  show: true,
                  uuid: "",
                  name: 'equipment_card_21',
                  objType: 'cube',
                  length: 60,
                  width: 65,
                  height: 20,
                  x: -150,
                  y: 60,
                  z: -430,
                  style: {
                      skinColor: 0x92630b,
                      skin: {
                          skin_up: {
                              skinColor: 0x92630b,
                              imgurl: "./mng/rack_inside.jpg",
                          },
                          skin_down: {
                              skinColor: 0x92630b,
                              imgurl: "./mng/rack_inside.jpg",
                          },
                          skin_fore: {
                              skinColor: 0x92630b,
                              imgurl: "./mng/rack_inside.jpg",
                          },
                          skin_behind: {
                              skinColor: 0x92630b,
                              imgurl: "./mng/server2.jpg",
                          },
                          skin_left: {
                              skinColor: 0x92630b,
                              imgurl: "./mng/rack_inside.jpg",
                          },
                          skin_right: {
                              skinColor: 0x92630b,
                              imgurl: "./mng/rack_inside.jpg",
                          }
                      }
                  }
              },
            //主机22
              {
                  show: true,
                  uuid: "",
                  name: 'equipment_card_22',
                  objType: 'cube',
                  length: 60,
                  width: 65,
                  height: 20,
                  x: -150,
                  y: 40,
                  z: -430,
                  style: {
                      skinColor: 0x92630b,
                      skin: {
                          skin_up: {
                              skinColor: 0x92630b,
                              imgurl: "./mng/rack_inside.jpg",
                          },
                          skin_down: {
                              skinColor: 0x92630b,
                              imgurl: "./mng/rack_inside.jpg",
                          },
                          skin_fore: {
                              skinColor: 0x92630b,
                              imgurl: "./mng/rack_inside.jpg",
                          },
                          skin_behind: {
                              skinColor: 0x92630b,
                              imgurl: "./mng/server2.jpg",
                          },
                          skin_left: {
                              skinColor: 0x92630b,
                              imgurl: "./mng/rack_inside.jpg",
                          },
                          skin_right: {
                              skinColor: 0x92630b,
                              imgurl: "./mng/rack_inside.jpg",
                          }
                      }
                  }
              },
            //主机52
              {
                  show: true,
                  uuid: "",
                  name: 'equipment_card_52',
                  objType: 'cube',
                  length: 60,
                  width: 65,
                  height: 20,
                  x: -150,
                  y: 170,
                  z: -430,
                  style: {
                      skinColor: 0x92630b,
                      skin: {
                          skin_up: {
                              skinColor: 0x92630b,
                              imgurl: "./mng/rack_inside.jpg",
                          },
                          skin_down: {
                              skinColor: 0x92630b,
                              imgurl: "./mng/rack_inside.jpg",
                          },
                          skin_fore: {
                              skinColor: 0x92630b,
                              imgurl: "./mng/rack_inside.jpg",
                          },
                          skin_behind: {
                              skinColor: 0x92630b,
                              imgurl: "./mng/server2.jpg",
                          },
                          skin_left: {
                              skinColor: 0x92630b,
                              imgurl: "./mng/rack_inside.jpg",
                          },
                          skin_right: {
                              skinColor: 0x92630b,
                              imgurl: "./mng/rack_inside.jpg",
                          }
                      }
                  }
              },
			//主机1
              {
                  show: true,
                  uuid: "",
                  name: 'equipment_card_1',
                  objType: 'cube',
                  length: 60,
                  width: 65,
                  height: 20,
                  x: -150,
                  y: 100,
                  z: -430,
                  style: {
                      skinColor: 0x92630b,
                      skin: {
                          skin_up: {
                              skinColor: 0x92630b,
                              imgurl: "./mng/rack_inside.jpg",
                          },
                          skin_down: {
                              skinColor: 0x92630b,
                              imgurl: "./mng/rack_inside.jpg",
                          },
                          skin_fore: {
                              skinColor: 0x92630b,
                              imgurl: "./mng/rack_inside.jpg",
                          },
                          skin_behind: {
                              skinColor: 0x92630b,
                              imgurl: "./mng/server2.jpg",
                          },
                          skin_left: {
                              skinColor: 0x92630b,
                              imgurl: "./mng/rack_inside.jpg",
                          },
                          skin_right: {
                              skinColor: 0x92630b,
                              imgurl: "./mng/rack_inside.jpg",
                          }
                      }
                  }
              },
            //主机2
              {
                  show: true,
                  uuid: "",
                  name: 'equipment_card_2',
                  objType: 'cube',
                  length: 60,
                  width: 65,
                  height: 20,
                  x: -150,
                  y: 120,
                  z: -430,
                  style: {
                      skinColor: 0x92630b,
                      skin: {
                          skin_up: {
                              skinColor: 0x92630b,
                              imgurl: "./mng/rack_inside.jpg",
                          },
                          skin_down: {
                              skinColor: 0x92630b,
                              imgurl: "./mng/rack_inside.jpg",
                          },
                          skin_fore: {
                              skinColor: 0x92630b,
                              imgurl: "./mng/rack_inside.jpg",
                          },
                          skin_behind: {
                              skinColor: 0x92630b,
                              imgurl: "./mng/server2.jpg",
                          },
                          skin_left: {
                              skinColor: 0x92630b,
                              imgurl: "./mng/rack_inside.jpg",
                          },
                          skin_right: {
                              skinColor: 0x92630b,
                              imgurl: "./mng/rack_inside.jpg",
                          }
                      }
                  }
              },
			//主机3
			{
				  show: true,
				  uuid: "",
				  name: 'equipment_card_4',
				  objType: 'bladeServer',
				  length: 60,
				  width: 65,
				  height: 30,
				  x: -150,
				  y: 145,
				  z: -430,
				  style: {
					  skinColor: 0x92630b,
					  skin: {
						  skin_up: {
							  skinColor: 0x92630b,
							  imgurl: "./mng/rack_inside.jpg",
						  },
						  skin_down: {
							  skinColor: 0x92630b,
							  imgurl: "./mng/rack_inside.jpg",
						  },
						  skin_fore: {
							  skinColor: 0x92630b,
							  imgurl: "./mng/rack_inside.jpg",
						  },
						  skin_behind: {
							  skinColor: 0x92630b,
							  imgurl: "./mng/server3.png",
						  },
						  skin_left: {
							  skinColor: 0x92630b,
							  imgurl: "./mng/rack_inside.jpg",
						  },
						  skin_right: {
							  skinColor: 0x92630b,
							  imgurl: "./mng/rack_inside.jpg",
						  }
					  }
				  },
				  childrens: [
						  {	  //card12
							  show: true,
							  uuid: "",
							  name: 'equipment_card_4_12',
							  objType: 'cube',
							  length: 58,
							  width: 3,
							  height: 28.5,
							  x: -2,
							  y: 0,
							  z: -3,
							  style: {
								  skinColor: 0x92630b,
								  skin: {
									  skin_up: {
										  skinColor: 0x92630b,
										  imgurl: "",
									  },
									  skin_down: {
										  skinColor: 0x92630b,
										  imgurl: "",
									  },
									  skin_fore: {
										  skinColor: 0x92630b,
										  imgurl: "",
									  },
									  skin_behind: {
										  skinColor: 0x92630b,
										  imgurl: "./mng/card4.png",
									  },
									  skin_left: {
										  skinColor: 0x92630b,
										  imgurl: "./mng/card_body.png",
									  },
									  skin_right: {
										  skinColor: 0x92630b,
										  imgurl: "./mng/card_body.png",
									  }
								  }
							  }
						  },
						  {	  //card13
							  show: true,
							  uuid: "",
							  name: 'equipment_card_4_13',
							  objType: 'cube',
							  length: 58,
							  width: 3,
							  height: 28.5,
							  x: -2,
							  y: 0,
							  z: -6,
							  style: {
								  skinColor: 0x92630b,
								  skin: {
									  skin_up: {
										  skinColor: 0x92630b,
										  imgurl: "",
									  },
									  skin_down: {
										  skinColor: 0x92630b,
										  imgurl: "",
									  },
									  skin_fore: {
										  skinColor: 0x92630b,
										  imgurl: "",
									  },
									  skin_behind: {
										  skinColor: 0x92630b,
										  imgurl: "./mng/card4.png",
									  },
									  skin_left: {
										  skinColor: 0x92630b,
										  imgurl: "./mng/card_body.png",
									  },
									  skin_right: {
										  skinColor: 0x92630b,
										  imgurl: "./mng/card_body.png",
									  }
								  }
							  }
						  },
						  {	  //card14
							  show: true,
							  uuid: "",
							  name: 'equipment_card_4_14',
							  objType: 'cube',
							  length: 58,
							  width: 3,
							  height: 28.5,
							  x: -2,
							  y: 0,
							  z: -9,
							  style: {
								  skinColor: 0x92630b,
								  skin: {
									  skin_up: {
										  skinColor: 0x92630b,
										  imgurl: "",
									  },
									  skin_down: {
										  skinColor: 0x92630b,
										  imgurl: "",
									  },
									  skin_fore: {
										  skinColor: 0x92630b,
										  imgurl: "",
									  },
									  skin_behind: {
										  skinColor: 0x92630b,
										  imgurl: "./mng/card4.png",
									  },
									  skin_left: {
										  skinColor: 0x92630b,
										  imgurl: "./mng/card_body.png",
									  },
									  skin_right: {
										  skinColor: 0x92630b,
										  imgurl: "./mng/card_body.png",
									  }
								  }
							  }
						  },
						  {	  //card15
							  show: true,
							  uuid: "",
							  name: 'equipment_card_4_15',
							  objType: 'cube',
							  length: 58,
							  width: 3,
							  height: 28.5,
							  x: -2,
							  y: 0,
							  z: -12,
							  style: {
								  skinColor: 0x92630b,
								  skin: {
									  skin_up: {
										  skinColor: 0x92630b,
										  imgurl: "",
									  },
									  skin_down: {
										  skinColor: 0x92630b,
										  imgurl: "",
									  },
									  skin_fore: {
										  skinColor: 0x92630b,
										  imgurl: "",
									  },
									  skin_behind: {
										  skinColor: 0x92630b,
										  imgurl: "./mng/card4.png",
									  },
									  skin_left: {
										  skinColor: 0x92630b,
										  imgurl: "./mng/card_body.png",
									  },
									  skin_right: {
										  skinColor: 0x92630b,
										  imgurl: "./mng/card_body.png",
									  }
								  }
							  }
						  },
						  {	  //card16
							  show: true,
							  uuid: "",
							  name: 'equipment_card_4_16',
							  objType: 'cube',
							  length: 58,
							  width: 3,
							  height: 28.5,
							  x: -2,
							  y: 0,
							  z: -15,
							  style: {
								  skinColor: 0x92630b,
								  skin: {
									  skin_up: {
										  skinColor: 0x92630b,
										  imgurl: "",
									  },
									  skin_down: {
										  skinColor: 0x92630b,
										  imgurl: "",
									  },
									  skin_fore: {
										  skinColor: 0x92630b,
										  imgurl: "",
									  },
									  skin_behind: {
										  skinColor: 0x92630b,
										  imgurl: "./mng/card4.png",
									  },
									  skin_left: {
										  skinColor: 0x92630b,
										  imgurl: "./mng/card_body.png",
									  },
									  skin_right: {
										  skinColor: 0x92630b,
										  imgurl: "./mng/card_body.png",
									  }
								  }
							  }
						  },
						  {	  //card17
							  show: true,
							  uuid: "",
							  name: 'equipment_card_4_17',
							  objType: 'cube',
							  length: 58,
							  width: 3,
							  height: 28.5,
							  x: -2,
							  y: 0,
							  z: -18,
							  style: {
								  skinColor: 0x92630b,
								  skin: {
									  skin_up: {
										  skinColor: 0x92630b,
										  imgurl: "",
									  },
									  skin_down: {
										  skinColor: 0x92630b,
										  imgurl: "",
									  },
									  skin_fore: {
										  skinColor: 0x92630b,
										  imgurl: "",
									  },
									  skin_behind: {
										  skinColor: 0x92630b,
										  imgurl: "./mng/card4.png",
									  },
									  skin_left: {
										  skinColor: 0x92630b,
										  imgurl: "./mng/card_body.png",
									  },
									  skin_right: {
										  skinColor: 0x92630b,
										  imgurl: "./mng/card_body.png",
									  }
								  }
							  }
						  },
						  {	  //card18
							  show: true,
							  uuid: "",
							  name: 'equipment_card_4_18',
							  objType: 'cube',
							  length: 58,
							  width: 3,
							  height: 28.5,
							  x: -2,
							  y: 0,
							  z: -21,
							  style: {
								  skinColor: 0x92630b,
								  skin: {
									  skin_up: {
										  skinColor: 0x92630b,
										  imgurl: "",
									  },
									  skin_down: {
										  skinColor: 0x92630b,
										  imgurl: "",
									  },
									  skin_fore: {
										  skinColor: 0x92630b,
										  imgurl: "",
									  },
									  skin_behind: {
										  skinColor: 0x92630b,
										  imgurl: "./mng/card2.png",
									  },
									  skin_left: {
										  skinColor: 0x92630b,
										  imgurl: "./mng/card_body.png",
									  },
									  skin_right: {
										  skinColor: 0x92630b,
										  imgurl: "./mng/card_body.png",
									  }
								  }
							  }
						  },
						  {	  //card19
							  show: true,
							  uuid: "",
							  name: 'equipment_card_4_19',
							  objType: 'cube',
							  length: 58,
							  width: 3,
							  height: 28.5,
							  x: -2,
							  y: 0,
							  z: -24,
							  style: {
								  skinColor: 0x92630b,
								  skin: {
									  skin_up: {
										  skinColor: 0x92630b,
										  imgurl: "",
									  },
									  skin_down: {
										  skinColor: 0x92630b,
										  imgurl: "",
									  },
									  skin_fore: {
										  skinColor: 0x92630b,
										  imgurl: "",
									  },
									  skin_behind: {
										  skinColor: 0x92630b,
										  imgurl: "./mng/card2.png",
									  },
									  skin_left: {
										  skinColor: 0x92630b,
										  imgurl: "./mng/card_body.png",
									  },
									  skin_right: {
										  skinColor: 0x92630b,
										  imgurl: "./mng/card_body.png",
									  }
								  }
							  }
						  },
						  {	  //card20
							  show: true,
							  uuid: "",
							  name: 'equipment_card_4_20',
							  objType: 'cube',
							  length: 58,
							  width: 5,
							  height: 28.5,
							  x: -2,
							  y: 0,
							  z: -28,
							  style: {
								  skinColor: 0x92630b,
								  skin: {
									  skin_up: {
										  skinColor: 0x92630b,
										  imgurl: "",
									  },
									  skin_down: {
										  skinColor: 0x92630b,
										  imgurl: "",
									  },
									  skin_fore: {
										  skinColor: 0x92630b,
										  imgurl: "",
									  },
									  skin_behind: {
										  skinColor: 0x92630b,
										  imgurl: "./mng/card1.png",
									  },
									  skin_left: {
										  skinColor: 0x92630b,
										  imgurl: "./mng/card_body.png",
									  },
									  skin_right: {
										  skinColor: 0x92630b,
										  imgurl: "./mng/card_body.png",
									  }
								  }
							  }
						  },
						  {//card01
							  show: true,
							  uuid: "",
							  name: 'equipment_card_4_01',
							  objType: 'cube',
							  length: 58,
							  width: 3,
							  height: 28.5,
							  x: -2,
							  y: 0,
							  z: 0,
							  style: {
								  skinColor: 0x92630b,
								  skin: {
									  skin_up: {
										  skinColor: 0x92630b,
										  imgurl: "",
									  },
									  skin_down: {
										  skinColor: 0x92630b,
										  imgurl: "",
									  },
									  skin_fore: {
										  skinColor: 0x92630b,
										  imgurl: "",
									  },
									  skin_behind: {
										  skinColor: 0x92630b,
										  imgurl: "./mng/card4.png",
									  },
									  skin_left: {
										  skinColor: 0x92630b,
										  imgurl: "./mng/card_body.png",
									  },
									  skin_right: {
										  skinColor: 0x92630b,
										  imgurl: "./mng/card_body.png",
									  }
								  }
							  }
						  },
						  {	  //card02
							  show: true,
							  uuid: "",
							  name: 'equipment_card_4_02',
							  objType: 'cube',
							  length: 58,
							  width: 3,
							  height: 28.5,
							  x: -2,
							  y: 0,
							  z: 3,
							  style: {
								  skinColor: 0x92630b,
								  skin: {
									  skin_up: {
										  skinColor: 0x92630b,
										  imgurl: "",
									  },
									  skin_down: {
										  skinColor: 0x92630b,
										  imgurl: "",
									  },
									  skin_fore: {
										  skinColor: 0x92630b,
										  imgurl: "",
									  },
									  skin_behind: {
										  skinColor: 0x92630b,
										  imgurl: "./mng/card4.png",
									  },
									  skin_left: {
										  skinColor: 0x92630b,
										  imgurl: "./mng/card_body.png",
									  },
									  skin_right: {
										  skinColor: 0x92630b,
										  imgurl: "./mng/card_body.png",
									  }
								  }
							  }
						  },
						  {	  //card03
							  show: true,
							  uuid: "",
							  name: 'equipment_card_4_03',
							  objType: 'cube',
							  length: 58,
							  width: 3,
							  height: 28.5,
							  x: -2,
							  y: 0,
							  z: 6,
							  style: {
								  skinColor: 0x92630b,
								  skin: {
									  skin_up: {
										  skinColor: 0x92630b,
										  imgurl: "",
									  },
									  skin_down: {
										  skinColor: 0x92630b,
										  imgurl: "",
									  },
									  skin_fore: {
										  skinColor: 0x92630b,
										  imgurl: "",
									  },
									  skin_behind: {
										  skinColor: 0x92630b,
										  imgurl: "./mng/card4.png",
									  },
									  skin_left: {
										  skinColor: 0x92630b,
										  imgurl: "./mng/card_body.png",
									  },
									  skin_right: {
										  skinColor: 0x92630b,
										  imgurl: "./mng/card_body.png",
									  }
								  }
							  }
						  },
						  {	  //card04
							  show: true,
							  uuid: "",
							  name: 'equipment_card_4_04',
							  objType: 'cube',
							  length: 58,
							  width: 3,
							  height: 28.5,
							  x: -2,
							  y: 0,
							  z: 9,
							  style: {
								  skinColor: 0x92630b,
								  skin: {
									  skin_up: {
										  skinColor: 0x92630b,
										  imgurl: "",
									  },
									  skin_down: {
										  skinColor: 0x92630b,
										  imgurl: "",
									  },
									  skin_fore: {
										  skinColor: 0x92630b,
										  imgurl: "",
									  },
									  skin_behind: {
										  skinColor: 0x92630b,
										  imgurl: "./mng/card4.png",
									  },
									  skin_left: {
										  skinColor: 0x92630b,
										  imgurl: "./mng/card_body.png",
									  },
									  skin_right: {
										  skinColor: 0x92630b,
										  imgurl: "./mng/card_body.png",
									  }
								  }
							  }
						  },
						  {	  //card05
							  show: true,
							  uuid: "",
							  name: 'equipment_card_4_05',
							  objType: 'cube',
							  length: 58,
							  width: 3,
							  height: 28.5,
							  x: -2,
							  y: 0,
							  z: 12,
							  style: {
								  skinColor: 0x92630b,
								  skin: {
									  skin_up: {
										  skinColor: 0x92630b,
										  imgurl: "",
									  },
									  skin_down: {
										  skinColor: 0x92630b,
										  imgurl: "",
									  },
									  skin_fore: {
										  skinColor: 0x92630b,
										  imgurl: "",
									  },
									  skin_behind: {
										  skinColor: 0x92630b,
										  imgurl: "./mng/card4.png",
									  },
									  skin_left: {
										  skinColor: 0x92630b,
										  imgurl: "./mng/card_body.png",
									  },
									  skin_right: {
										  skinColor: 0x92630b,
										  imgurl: "./mng/card_body.png",
									  }
								  }
							  }
						  },
						  {	  //card06
							  show: true,
							  uuid: "",
							  name: 'equipment_card_4_06',
							  objType: 'cube',
							  length: 58,
							  width: 3,
							  height: 28.5,
							  x: -2,
							  y: 0,
							  z: 15,
							  style: {
								  skinColor: 0x92630b,
								  skin: {
									  skin_up: {
										  skinColor: 0x92630b,
										  imgurl: "",
									  },
									  skin_down: {
										  skinColor: 0x92630b,
										  imgurl: "",
									  },
									  skin_fore: {
										  skinColor: 0x92630b,
										  imgurl: "",
									  },
									  skin_behind: {
										  skinColor: 0x92630b,
										  imgurl: "./mng/card4.png",
									  },
									  skin_left: {
										  skinColor: 0x92630b,
										  imgurl: "./mng/card_body.png",
									  },
									  skin_right: {
										  skinColor: 0x92630b,
										  imgurl: "./mng/card_body.png",
									  }
								  }
							  }
						  },
						  {	  //card07
							  show: true,
							  uuid: "",
							  name: 'equipment_card_4_07',
							  objType: 'cube',
							  length: 58,
							  width: 3,
							  height: 28.5,
							  x: -2,
							  y: 0,
							  z: 18,
							  style: {
								  skinColor: 0x92630b,
								  skin: {
									  skin_up: {
										  skinColor: 0x92630b,
										  imgurl: "",
									  },
									  skin_down: {
										  skinColor: 0x92630b,
										  imgurl: "",
									  },
									  skin_fore: {
										  skinColor: 0x92630b,
										  imgurl: "",
									  },
									  skin_behind: {
										  skinColor: 0x92630b,
										  imgurl: "./mng/card4.png",
									  },
									  skin_left: {
										  skinColor: 0x92630b,
										  imgurl: "./mng/card_body.png",
									  },
									  skin_right: {
										  skinColor: 0x92630b,
										  imgurl: "./mng/card_body.png",
									  }
								  }
							  }
						  },
						  {	  //card08
							  show: true,
							  uuid: "",
							  name: 'equipment_card_4_08',
							  objType: 'cube',
							  length: 58,
							  width: 3,
							  height: 28.5,
							  x: -2,
							  y: 0,
							  z: 21,
							  style: {
								  skinColor: 0x92630b,
								  skin: {
									  skin_up: {
										  skinColor: 0x92630b,
										  imgurl: "",
									  },
									  skin_down: {
										  skinColor: 0x92630b,
										  imgurl: "",
									  },
									  skin_fore: {
										  skinColor: 0x92630b,
										  imgurl: "",
									  },
									  skin_behind: {
										  skinColor: 0x92630b,
										  imgurl: "./mng/card5.png",
									  },
									  skin_left: {
										  skinColor: 0x92630b,
										  imgurl: "./mng/card_body.png",
									  },
									  skin_right: {
										  skinColor: 0x92630b,
										  imgurl: "./mng/card_body.png",
									  }
								  }
							  }
						  },
						  {	  //card09
							  show: true,
							  uuid: "",
							  name: 'equipment_card_4_09',
							  objType: 'cube',
							  length: 58,
							  width: 3,
							  height: 28.5,
							  x: -2,
							  y: 0,
							  z: 24,
							  style: {
								  skinColor: 0x92630b,
								  skin: {
									  skin_up: {
										  skinColor: 0x92630b,
										  imgurl: "",
									  },
									  skin_down: {
										  skinColor: 0x92630b,
										  imgurl: "",
									  },
									  skin_fore: {
										  skinColor: 0x92630b,
										  imgurl: "",
									  },
									  skin_behind: {
										  skinColor: 0x92630b,
										  imgurl: "./mng/card5.png",
									  },
									  skin_left: {
										  skinColor: 0x92630b,
										  imgurl: "./mng/card_body.png",
									  },
									  skin_right: {
										  skinColor: 0x92630b,
										  imgurl: "./mng/card_body.png",
									  }
								  }
							  }
						  },
						  {	  //card10
							  show: true,
							  uuid: "",
							  name: 'equipment_card_4_10',
							  objType: 'cube',
							  length: 58,
							  width: 3,
							  height: 28.5,
							  x: -2,
							  y: 0,
							  z: 27,
							  style: {
								  skinColor: 0x92630b,
								  skin: {
									  skin_up: {
										  skinColor: 0x92630b,
										  imgurl: "",
									  },
									  skin_down: {
										  skinColor: 0x92630b,
										  imgurl: "",
									  },
									  skin_fore: {
										  skinColor: 0x92630b,
										  imgurl: "",
									  },
									  skin_behind: {
										  skinColor: 0x92630b,
										  imgurl: "./mng/card5.png",
									  },
									  skin_left: {
										  skinColor: 0x92630b,
										  imgurl: "./mng/card_body.png",
									  },
									  skin_right: {
										  skinColor: 0x92630b,
										  imgurl: "./mng/card_body.png",
									  }
								  }
							  }
						  },
					]

			 },

        ],
        events: {
            dbclick: [
                {
                    obj_name: "doorRight",
                    obj_uuid: "",
                    obj_event: function (_obj,_mouse) {
                        openRightDoor(_obj, function () { });
                    }
                },
                {
                    obj_name: "doorLeft",
                    obj_uuid: "",
                    obj_event: function (_obj,_mouse) {
                        var doorstate = "close";
                        var tempobj = null;
                        if (_obj.doorState != null && typeof (_obj.doorState) != 'undefined') {
                            doorstate = _obj.doorState;
                            tempobj = _obj.parent;
                        } else {
                            console.log("add parent");
                            var _objparent = _obj.parent;
                            tempobj = new THREE.Object3D();
                            tempobj.position.set(_obj.position.x + _obj.geometry.parameters.width / 2, _obj.position.y, _obj.position.z);
                            _obj.position.set(-_obj.geometry.parameters.width / 2, 0, 0);
                            tempobj.add(_obj);
                            _objparent.add(tempobj);
                        }
                        _obj.doorState = (doorstate == "close" ? "open" : "close");
                        new TWEEN.Tween(tempobj.rotation).to({
                            y: (doorstate == "close" ? -0.25 * 2 * Math.PI : 0 * 2 * Math.PI)
                        }, 10000).easing(TWEEN.Easing.Elastic.Out).start();
                    }
                },
                 {
                     obj_name: "cabinetdoor3_1",
                     obj_uuid: "",
                     obj_event: function (_obj,_mouse) {
                         opcabinetdoor(_obj);
                     }
                 },
                 {
                     findObject:function(_objname){//查找某一类符合名称的对象
                         if (_objname.indexOf("cabinet") >= 0 && _objname.indexOf("door") >= 0) {
                             return true;
                         } else {
                             return false;
                         }
                     },
                     obj_uuid: "",
                     obj_event: function (_obj,_mouse) {
                         opcabinetdoor(_obj);

                         // var doorstate = "close";
                         //
                         // if (_obj.doorState != null && typeof (_obj.doorState) != 'undefined') {
                         //     doorstate = _obj.doorState;
                         // }
                         // _obj.doorState = (doorstate == "close" ? "open" : "close");
                         //
                         // var RotatingObject = new THREE.RotatingObject(_obj);
                         // var min = RotatingObject.getBoundingBoxMin().clone();
                         // var max = RotatingObject.getBoundingBoxMax().clone();
                         // var vec = max.clone();
                         // //vec.x = max.x;
                         // //vec.y = max.y;
                         //
                         // RotatingObject.setOrigin(vec);
                         // if(_obj.doorState == "close") {
                         //     var doorCorner = new THREE.Vector3(0,  -Math.PI / 2,0);
                         //     RotatingObject.rotate(doorCorner);
                         // }
                         // else {
                         //     var doorCorner = new THREE.Vector3(0,  Math.PI / 2,0);
                         //     RotatingObject.rotate(doorCorner);
                         // }

                     }
                 },
                 {
                     findObject: function (_objname) {//查找某一类符合名称的对象
                         if (_objname.indexOf("equipment") >= 0 && _objname.indexOf("card") >= 0) {
							 //alert("equipment");
                             return true;
                         } else {
                             return false;
                         }
                     },
                     obj_uuid: "",
                     obj_event: function (_obj,_mouse) {
                         var cardstate = "in";
                         if (_obj.cardstate != null && typeof (_obj.cardstate) != 'undefined') {
                             cardstate = _obj.cardstate;
                         } else {
                             _obj.cardstate = "out";
                         }
                         new TWEEN.Tween(_obj.position).to({
                             x: (cardstate == "in" ? _obj.position.x - 50 : _obj.position.x + 50),
                         }, 1000).onComplete(function () { _obj.cardstate = cardstate == "in" ? "out" : "in"; }).start();
                     }
                 }
            ],
            mouseDown: [
				 {
                     findObject: function (_objname) {//查找某一类符合名称的对象
                         if (_objname.indexOf("equipment") >= 0 && _objname.indexOf("card") >= 0) {
							 //alert("equipment");
                             return true;
                         } else {
                             return false;
                         }
                     },
                     obj_uuid: "",
                     obj_event: function (_obj,_mouse) {

						var objs=[
							{id:'devname',
							 name:'设备名称：',
							 type:'',
							 value: 'huawei交换机'
							},
							{id:'devtype',
							 name:'类型：',
							 type:'',
							 value: '交换机'
							},
							{id:'devip',
							 name:'IP：',
							 type:'',
							 value: '192.168.0.1'
							},
							{id:'upbw',
							 name:'上行带宽：',
							 type:'',
							 value: '191'
							},
							{id:'downbw',
							 name:'下行带宽：',
							 type:'',
							 value: '168'
							}
						 ];
                         showDiv('main',false,true,_mouse,objs);

						 //showVideoDiv('main',false,false,_mouse,objs);

						 if(t1>0)
							 clearInterval(t1);
						 t1 = window.setInterval(updateDivItemVaule,500);

                     }
                 },
				 {
                     findObject: function (_objname) {//查找某一类符合名称的对象
                         if (_objname.indexOf("camera") >= 0) {
							 //alert("equipment");
                             return true;
                         } else {
                             return false;
                         }
                     },
                     obj_uuid: "",
                     obj_event: function (_obj,_mouse) {

						 showVideoDiv('main',false,false,_mouse,null);

                     }
                 }
            ],
            mouseUp: {
            },
            mouseMove: {
            }
        },
        btns: [
            {
                btnid: "btn_reset",
                btnTitle: "场景复位",
                btnimg: "./mng/reset.png",
                event: function () {
                    $('#canvas-frame').empty();
					p3DObj = null;
                    pstation = null;
                    pstation = new p3D();
                    pstation.initp3D('canvas-frame', initOption, Aobjects);
                    pstation.start();
                    //var mainCamera = p3DObj.commonFunc.findObject("mainCamera");//主摄像机
                    //new TWEEN.Tween(mainCamera.position).to({
                    //    x: 0, y: 1000, z: -1800,
                    //}, 1000).start();
                    //mainCamera.lookAt({ x: 0, y: 0, z: 0 });
                }
            },
            {
                btnid: "btn_connection",
                btnTitle: "走线管理",
                btnimg: "./mng/connection.png",
                event: function () {
                	//alert("走线管理");
                  var vlinename='line0001';
                  var vtxtflag='nettext';
                  if(!pstation.mconnection) {
                    var vinfo = {
                           name:vlinename,
                           type:'beeline',
                           visible:true,
                           imgurl: 'mng/UV_Grid_Sm.jpg',
                           radiu:1.0,
                           scene:true
                           };
                    var lines=[
                      {x: -150,
                       y: 145,
                       z: -430
                      },
                      {x: -100,
                       y: 145,
                       z: -430
                      },
                      {x: -100,
                       y: 210,
                       z: -430
                      },
                      {x: -130,
                       y: 210,
                       z: -430
                      },
                      {x: -130,
                       y: 240,
                       z: -430
                      },
                      {x: -130,
                       y: 240,
                       z: 250
                      },
                      {x: 70,
                       y: 240,
                       z: 250
                      },
                      {x: 70,
                       y: 240,
                       z: 20
                      },
                      {x: 70,
                       y: 210,
                       z: 20
                      },
                      {x: 100,
                       y: 210,
                       z: 20
                      },
                      {x: 100,
                       y: 160,
                       z: 20
                      },
                     ];
                     p3DObj.addTunnel(vinfo,lines);

                    var vparam={
                           name:vtxtflag,
                           position:{x:10,y:50,z:-10},
                           size:{x:256,y:128,z:60},
                           color:{r:244, g:120, b:32, a:0.4},
                           imgurl: 'mng/textmark.jpg',
                           rows: [
                             {
                             name:'item1',
                             fontface:'Arial',
                             fontsize:20,
                             borderThickness:32,
                             textColor:{r:255, g:255, b:255, a:1.0},
                             text:'当前网络流量',
                             size:{x:20,y:20},
                             position:{x:10,y:30,z:0},
                             },
                             {
                             name:'item2',
                             fontface:'Arial',
                             fontsize:60,
                             borderThickness:14,
                             textColor:{r:255, g:255, b:255, a:1.0},
                             text:'170.8',
                             size:{x:20,y:20},
                             position:{x:10,y:80,z:0},
                             },
                             {
                             name:'item3',
                             fontface:'Arial',
                             fontsize:24,
                             borderThickness:14,
                             textColor:{r:255, g:255, b:255, a:1.0},
                             text:'Mb/s',
                             size:{x:20,y:20},
                             position:{x:190,y:90,z:0},
                             },
                           ]
                           };


                    //p3DObj.commonFunc.makeDynamicTextSprite("equipment_card_3*",vparam);
                    var vparam2={
                         name:vtxtflag,
                         position:{x:-110,y:240,z:0},
                         size:{x:256,y:128,z:60},
                         color:{r:34, g:76, b:143, a:0.8},
                         imgurl: '',
                         rows: [
                           {
                           name:'item1',
                           fontface:'Arial',
                           fontsize:20,
                           borderThickness:32,
                           textColor:{r:255, g:255, b:255, a:1.0},
                           text:'当前上行带宽',
                           size:{x:20,y:20},
                           position:{x:10,y:30,z:0},
                           },
                           {
                           name:'item2',
                           fontface:'Arial',
                           fontsize:60,
                           borderThickness:14,
                           textColor:{r:255, g:255, b:255, a:1.0},
                           text:'345.8',
                           size:{x:20,y:20},
                           position:{x:10,y:80,z:0},
                           },
                           {
                           name:'item3',
                           fontface:'Arial',
                           fontsize:24,
                           borderThickness:14,
                           textColor:{r:255, g:255, b:255, a:1.0},
                           text:'Mb/s',
                           size:{x:20,y:20},
                           position:{x:190,y:90,z:0},
                           },
                         ]
                         };
                    p3DObj.commonFunc.makeDynamicTextSprite("equipment_card_23",vparam2);
                    p3DObj.commonFunc.makeDynamicTextSprite("equipment_card_52",vparam);
                    /**/


                  } else {
                    p3DObj.delSenceObject(vtxtflag,true);
                    p3DObj.delSenceObject(vlinename,false);
                  }
                  pstation.mconnection=!pstation.mconnection;

                }
            },
            {
                btnid: "btn_edit",
                btnTitle: "拖拽机柜",
                btnimg: "./mng/edit.png",
                event: function () {
					alert("拖拽机柜");
					//document.getElementById('light').style.display='block';
					//alert(1);
					//document.getElementById('fade').style.display='block'
					//for(var i=0;i<1;i++)
					//	p3DObj.commonFunc.makeTextSprite("equipment_card_3",null);
                }
            },
            {
                btnid: "btn_temperature",
                btnTitle: "温度监控",
                btnimg: "./mng/temperature.png",
                event: function () {
					//alert("温度监控");
					var vtname='temperature2001';
					if(!pstation.mtemperature) {
						var vinfo= {
									name:vtname,
									width:1300,
									height:220,
									pic:'./mng/temp1.jpg',
									transparent:true,
									opacity:1,
									blending:false,
									color:{r:255, g:255, b:255, a:1.0},
									position:{x: -50, y: 120, z: -500},
									rotation:{x: 0.0, y: 0.0, z: 0.0},
								  };
						p3DObj.addPlane(vinfo);

					} else {
						p3DObj.delSenceObject(vtname,false);
					}
					pstation.mtemperature=!pstation.mtemperature;
                }
            },
            {
                btnid: "btn_usage",
                btnTitle: "机柜利用率",
                btnimg: "./mng/usage.png",
                event: function () {
					//alert("机柜利用率");
					var vtname="space5401";

					var vw,vh,vl;
					var vx,vy,vz;
					var vx2,vy2,vz2;
					var vMinx=5;
					var vMaxx=200;
					var vcolor=[0xf8aba6,0xfaa755,0x78a355,0x45b97c,0x7fb80e,0xd93a49];
					var vcount=1;

					if(!pstation.musage) {
							$.each(Aobjects.objects, function (index,_obj) {
							if (_obj.show == null || typeof (_obj.show) == 'undefined' || _obj.show) {
								 switch (_obj.objType) {
									 case 'emptyCabinet':
									 case 'cloneObj':
										var vrandomh=(Math.random()*(vMaxx-vMinx+1)+vMinx);
										var vrandomi=Math.floor(Math.random()*6);
										//var vobjname=vtname+index;
										if('emptyCabinet'==_obj.objType) {
											vw=_obj.size.width;
											vh=_obj.size.height;
											vl=_obj.size.length;
											vx=_obj.position.x;
											vy=_obj.position.y;
											vz=_obj.position.z;
											vx2=vx;
											vy2=vy;
											vz2=vz;
										} else {
											vx2=vx+_obj.position.x;
											vy2=vy+_obj.position.y;
											vz2=vz+_obj.position.z;
											vcount++;
										}
										var vobjinfo= {
											name:vtname,
											transparent:true,
											opacity:0.8,
											blending:false,
											wireframe:false,
											tween:0,
											color:vcolor[vrandomi],
											size:{l: vl, w: vw, h: vh},
											position:{x: vx2, y: vy2, z: vz2},
											rotation:{x: 0.0, y: 0.0, z: 0.0},
										  };
										if(39!=vcount)
											p3DObj.addBox(vobjinfo);


										break;
								 }
							};
						 });

						vobjinfo= {
							name:vtname,
							transparent:false,
							opacity:0.8,
							blending:false,
							wireframe:false,
							tween:0,
							color:0xffffff,
							size:{l: 60, w: 65, h: 18},
							position:{x: -150, y: 100, z: -430},
							rotation:{x: 0.0, y: 0.0, z: 0.0},
						  };
						  p3DObj.addBox(vobjinfo);

						vobjinfo= {
							name:vtname,
							transparent:false,
							opacity:0.8,
							blending:false,
							wireframe:false,
							tween:0,
							color:0xffffff,
							size:{l: 60, w: 65, h: 18},
							position:{x: -150, y: 120, z: -430},
							rotation:{x: 0.0, y: 0.0, z: 0.0},
						  };
						  p3DObj.addBox(vobjinfo);

						vobjinfo= {
							name:vtname,
							transparent:false,
							opacity:0.8,
							blending:false,
							wireframe:false,
							tween:0,
							color:0xffffff,
							size:{l: 60, w: 65, h: 28},
							position:{x: -150, y: 145, z: -430},
							rotation:{x: 0.0, y: 0.0, z: 0.0},
						  };
						  p3DObj.addBox(vobjinfo);

						vobjinfo= {
							name:vtname,
							transparent:false,
							opacity:0.8,
							blending:false,
							wireframe:false,
							tween:0,
							color:0xffffff,
							size:{l: 60, w: 65, h: 18},
							position:{x: -150, y: 170, z: -430},
							rotation:{x: 0.0, y: 0.0, z: 0.0},
						  };
						  p3DObj.addBox(vobjinfo);

						vobjinfo= {
							name:vtname,
							transparent:false,
							opacity:0.8,
							blending:false,
							wireframe:false,
							tween:0,
							color:0xffffff,
							size:{l: 60, w: 65, h: 18},
							position:{x: -150, y: 80, z: -430},
							rotation:{x: 0.0, y: 0.0, z: 0.0},
						  };
						  p3DObj.addBox(vobjinfo);

						vobjinfo= {
							name:vtname,
							transparent:false,
							opacity:0.8,
							blending:false,
							wireframe:false,
							tween:0,
							color:0xffffff,
							size:{l: 60, w: 65, h: 18},
							position:{x: -150, y: 60, z: -430},
							rotation:{x: 0.0, y: 0.0, z: 0.0},
						  };
						  p3DObj.addBox(vobjinfo);


						  						vobjinfo= {
							name:vtname,
							transparent:false,
							opacity:0.8,
							blending:false,
							wireframe:false,
							tween:0,
							color:0xffffff,
							size:{l: 60, w: 65, h: 18},
							position:{x: -150, y: 40, z: -430},
							rotation:{x: 0.0, y: 0.0, z: 0.0},
						  };
						  p3DObj.addBox(vobjinfo);

						vobjinfo= {
							name:vtname,
							transparent:true,
							opacity:0.8,
							blending:false,
							wireframe:false,
							tween:0,
							color:vcolor[0],
							size:{l: 60, w: 65, h: 22},
							position:{x: -150, y: 193, z: -430},
							rotation:{x: 0.0, y: 0.0, z: 0.0},
						  };
						  p3DObj.addBox(vobjinfo);

						vobjinfo= {
							name:vtname,
							transparent:true,
							opacity:0.8,
							blending:false,
							wireframe:false,
							tween:0,
							color:vcolor[1],
							size:{l: 60, w: 65, h: 26},
							position:{x: -150, y: 16, z: -430},
							rotation:{x: 0.0, y: 0.0, z: 0.0},
						  };
						  p3DObj.addBox(vobjinfo);

						p3DObj.showObject('cabinet',false,true);
						p3DObj.showObject('equipment',false,true);
					} else {
						p3DObj.delSenceObject(vtname,true);
						p3DObj.showObject('cabinet',true,true);
						p3DObj.showObject('equipment',true,true);
					}
					pstation.musage=!pstation.musage;
                }
            },
            {
                btnid: "btn_space",
                btnTitle: "空间利用率",
                btnimg: "./mng/space.png",
                event: function () {
					//alert("空间利用率");
					var vtname="space4401";

					var vw,vh,vl;
					var vx,vy,vz;
					var vx2,vy2,vz2;
					var vMinx=5;
					var vMaxx=200;
					var vcolor=[0xf8aba6,0xfaa755,0x78a355,0x45b97c,0x7fb80e,0xd93a49];

					if(!pstation.mspace) {
							 $.each(Aobjects.objects, function (index,_obj) {
							if (_obj.show == null || typeof (_obj.show) == 'undefined' || _obj.show) {
								 switch (_obj.objType) {
									 case 'emptyCabinet':
									 case 'cloneObj':
										//var vobjname=vtname+index;
										if('emptyCabinet'==_obj.objType) {
											vw=_obj.size.width;
											vh=_obj.size.height;
											vl=_obj.size.length;
											vx=_obj.position.x;
											vy=_obj.position.y;
											vz=_obj.position.z;
											vx2=vx;
											vy2=vy;
											vz2=vz;
										} else {
											vx2=vx+_obj.position.x;
											vy2=vy+_obj.position.y;
											vz2=vz+_obj.position.z;
										}
										var vobjinfo= {
											name:vtname,
											transparent:false,
											opacity:0.8,
											blending:false,
											wireframe:true,
											tween:0,
											color:0xffffff,
											size:{l: vl, w: vw, h: vh},
											position:{x: vx2, y: vy2, z: vz2},
											rotation:{x: 0.0, y: 0.0, z: 0.0},
										  };
										p3DObj.addBox(vobjinfo);

										var vrandomh=(Math.random()*(vMaxx-vMinx+1)+vMinx);
										var vrandomi=Math.floor(Math.random()*6);
										var vinfo= {
											name:vtname,
											transparent:false,
											opacity:0.8,
											blending:false,
											wireframe:false,
											tween:2500,
											color:vcolor[vrandomi],
											size:{l: vl-0.5, w: vw-0.5, h: vrandomh},
											position:{x: vx2, y: 1, z: vz2},
											rotation:{x: 0.0, y: 0.0, z: 0.0},
										  };
										p3DObj.addBox(vinfo);
										break;
								 }
							};
						 });
						p3DObj.showObject('cabinet',false,true);
						p3DObj.showObject('equipment',false,true);
					} else {
						p3DObj.delSenceObject(vtname,true);
						p3DObj.showObject('cabinet',true,true);
						p3DObj.showObject('equipment',true,true);
					}
					pstation.mspace=!pstation.mspace;
                }
            },
			      {
                btnid: "btn_air",
                btnTitle: "空调风向",
                btnimg: "./mng/air.png",
                event: function () {
                	//alert("空调风向");
					var vlinename='nurbs1001';
					if(!pstation.mair) {
						var vinfo= {
									 name:vlinename,
									 type:'nurbs',
									 position:{x: -90, y: 200, z: -430},
									 size:{x:20,y:20},
									 color:{r:255, g:255, b:255, a:1.0},
									 imgurl: './mng/arrow.png',
								   };
						p3DObj.addNurbs(vinfo,null);
						//p3DObj.loadObj(null);
					} else {
						p3DObj.delSenceObject(vlinename,false);
					}
					pstation.mair=!pstation.mair;
                }
            },
            {
                btnid: "btn_smoke",
                btnTitle: "烟雾监测",
                btnimg: "./mng/smoke.png",
                event: function () {
					//alert("烟雾监测");
					var vlinename='nurbs1001';
					var vlinename2='nurbs1002';
					if(!pstation.msmoke) {
						var vinfo= {
							 name:vlinename,
							 type:'nurbs',
							 position:{x: -150, y: 210, z: -280, w: 3},
							 size:{x:150,y:300,z:150},
							 number:350,
							 color:0xd71345,
							 imgurl: './mng/smoking.png',
						   };
						p3DObj.addSprite(vinfo);

						var vinfo2= {
							 name:vlinename2,
							 type:'nurbs',
							 position:{x: 250, y: 310, z: 0, w: 1},
							 size:{x:250,y:300,z:250},
							 number:350,
							 color:0xffffff,
							 imgurl: './mng/smoking.png',
						   };
						p3DObj.addSprite(vinfo2);
					} else {
						p3DObj.delSenceObject(vlinename,true);
						p3DObj.delSenceObject(vlinename2,true);
					}
					pstation.msmoke=!pstation.msmoke;
                }
            },
            {
                btnid: "btn_water",
                btnTitle: "漏水监测",
                btnimg: "./mng/water.png",
                event: function () {
					//alert("漏水监测");
					var vlinename='loushuitunnel01';
					var vlinename2='loushuitunnel02';
					if(!pstation.mwater) {
						p3DObj.showObject('equipment',false,true);
						//p3DObj.showObject('wall',false,true);
						p3DObj.showObjectOpacity('cabinet',0.05,true);

						var vinfo = {
									 name:vlinename,
									 type:'beeline',
									 visible:true,
									 radiu:5.0,
									 imgurl: 'mng/metal.png',
									 scene:true
								   };
						var lines=[
									{x: -650,
									 y: 10,
									 z: -550
									},
									{x: -650,
									 y: 10,
									 z: 330
									},
									{x: 130,
									 y: 10,
									 z: 330
									},
									{x: 130,
									 y: 10,
									 z: 600
									},
									{x: 540,
									 y: 10,
									 z: 600
									},
									{x: 540,
									 y: 10,
									 z: -550
									},
									{x: -650,
									 y: 10,
									 z: -550
									},
								];
						 p3DObj.addTunnel(vinfo,lines);


						 vinfo = {
									 name:vlinename2,
									 type:'beeline',
									 visible:true,
									 radiu:5.0,
									 imgurl: 'mng/UV_Grid_Sm.jpg',
									 scene:true
								   };
						lines=[
									{x: -400,
									 y: 10,
									 z: -400
									},
									{x: -400,
									 y: 10,
									 z: 210
									},
									{x: 80,
									 y: 10,
									 z: 210
									},
									{x: 80,
									 y: 10,
									 z: -350
									},
									{x: 250,
									 y: 10,
									 z: -350
									},
									{x: 250,
									 y: 10,
									 z: 130
									},
									{x: 160,
									 y: 10,
									 z: 130
									},
								];
						 p3DObj.addTunnel(vinfo,lines);

					} else {
						p3DObj.showObject('equipment',true,true);
						p3DObj.showObjectOpacity('cabinet',1.0,true);
						p3DObj.delSenceObject(vlinename,false);
						p3DObj.delSenceObject(vlinename2,false);
					}

					pstation.mwater=!pstation.mwater;

					/*
					var vobjinof={
									 name:'camera001',
									 type:'camera',
									 visible:true,
									 position:{x:-130,y:240,z:360},
									 size:{x:1,y:1,z:1},
									 rotation: { x:0,y:0,z:0},
									 modelurl: './mng/model.json',
								   };
					p3DObj.loadObj(vobjinof);
					*/
                }
            },
            {
                btnid: "btn_security",
                btnTitle: "防盗监测",
                btnimg: "./mng/security.png",
                event: function () {
                	//alert("防盗监测");
					//p3DObj.commonFunc.makeTest("equipment_card_3",null);
					var vx=5;
					var vy=30;
					var vz=5;
					for ( var i = 0; i < 5; i ++ ) {
						var vlinename='securityline01'+i;
						var vlinename2='securityline21'+i;
						if(!pstation.msecurity) {
							var vlineinfo= {
										 name:vlinename,
										 type:'',
										 position:{x:0,y:0,z:0},
										 size:{x:20,y:20},
										 colortype:'gradient3',
										 color:0xff00ff,
										 imgurl: '../mng/arrow.png',
									   };
							var lines=[
								{x: -700,
								 y: 30+(i*vy),
								 z: -500
								},
								{x: 600,
								 y: 30+(i*vy),
								 z: -500
								},
							 ];
							 p3DObj.addLine(vlineinfo,lines);
							 /**/
							var vlineinfo2= {
										 name:vlinename2,
										 type:'',
										 position:{x:0,y:0,z:0},
										 size:{x:20,y:20},
										 colortype:'gradient3',
										 color:0xff00ff,
										 imgurl: '../mng/arrow.png',
									   };
							 var lines2=[
											{x: -500,
											 y: 30+(i*vy),
											 z: 350
											},
											{x: -500,
											 y: 30+(i*vy),
											 z: -600
											},
										  ];
							 p3DObj.addLine(vlineinfo2,lines2);

						} else {
							p3DObj.delSenceObject(vlinename,false);
							//console.log( i+"="+vlinename[i] );
							p3DObj.delSenceObject(vlinename2,false);
						}
					}

					pstation.msecurity=!pstation.msecurity;
                }
            },
			      {
                btnid: "btn_power",
                btnTitle: "供电电缆",
                btnimg: "./mng/power.png",
                event: function () {
                	//alert("供电电缆");
					var vx=5;
					var vy=3;
					var vz=5;
					for ( var i = 0; i < 3; i ++ ) {
						var vlinename='powerline01'+i;
						var vlinename2='powerline21'+i;
						if(!pstation.mpower) {
							var vlineinfo= {
										 name:vlinename,
										 type:'',
										 position:{x:0,y:0,z:0},
										 size:{x:20,y:20},
										 colortype:'gradient',
										 color:0xff00ff,
										 imgurl: '../mng/arrow.png',
									   };
							var lines=[
								{x: -120+(i*vx),
								 y: 145+(i*vy),
								 z: -180+(i*vz)
								},
								{x: -50+(i*vx),
								 y: 145+(i*vy),
								 z: -180+(i*vz)
								},
								{x: -50+(i*vx),
								 y: 210+(i*vy),
								 z: -180+(i*vz)
								},
								{x: -100+(i*vx),
								 y: 210+(i*vy),
								 z: -180+(i*vz)
								},
								{x: -100+(i*vx),
								 y: 240+(i*vy),
								 z: -180+(i*vz)
								},
								{x: -100+(i*vx),
								 y: 240+(i*vy),
								 z: 550+(i*vz)
								},
								{x: -500+(i*vx),
								 y: 240+(i*vy),
								 z: 550+(i*vz)
								},
								{x: 500+(i*vx),
								 y: 240+(i*vy),
								 z: 550+(i*vz)
								},
							 ];
							 p3DObj.addLine(vlineinfo,lines);
							 /**/
							var vlineinfo2= {
										 name:vlinename2,
										 type:'',
										 position:{x:0,y:0,z:0},
										 size:{x:20,y:20},
										 colortype:'gradient',
										 color:0xff00ff,
										 imgurl: '../mng/arrow.png',
									   };
							 var lines2=[
											{x: -100+(i*vx),
											 y: 240+(i*vy),
											 z: 320+(i*vz)
											},
											{x: 100+(i*vx),
											 y: 240+(i*vy),
											 z: 320+(i*vz)
											},
											{x: 100+(i*vx),
											 y: 240+(i*vy),
											 z: 20+(i*vz)
											},
											{x: 100+(i*vx),
											 y: 210+(i*vy),
											 z: 20+(i*vz)
											},
											{x: 140+(i*vx),
											 y: 210+(i*vy),
											 z: 20+(i*vz)
											},
											{x: 140+(i*vx),
											 y: 160+(i*vy),
											 z: 20+(i*vz)
											},
										  ];
							 p3DObj.addLine(vlineinfo2,lines2);

						} else {
							p3DObj.delSenceObject(vlinename,false);
							//console.log( i+"="+vlinename[i] );
							p3DObj.delSenceObject(vlinename2,false);
						}
					}

					pstation.mpower=!pstation.mpower;
                }
            },
            {
                btnid: "btn_person",
                btnTitle: "告警巡航",
                btnimg: "./mng/person.png",
                event: function () {
					/*
                    var mainCamera = p3DObj.commonFunc.findObject("mainCamera");//主摄像机
                    var doorRight = p3DObj.commonFunc.findObject("doorRight");

                    mainCamera.lookAt(doorRight.position);
                    new TWEEN.Tween(mainCamera.position).to({
                        x:-300, y:200, z:-700,
                    }, 5000).onComplete(function () {

                        openRightDoor(p3DObj.commonFunc.findObject("doorRight"), function () {
                            var cabinet3_1 = p3DObj.commonFunc.findObject("cabinet3_1");
                            mainCamera.lookAt(cabinet3_1.position);
                            new TWEEN.Tween(mainCamera.position).to({
                                x: -300, y: 150, z: -200,
                            }, 5000).onComplete(function () {

                                mainCamera.lookAt(cabinet3_1.position);
                            }).start();
                        });

                    }).start();
					DynamicPath(mainCamera,lines,0);
					*/
					var vname='dynamicPath001';
					if(!pstation.mperson) {
						var vInfo={
									 name:vname,
									 type:'beeline',
									 visible:true,
									 radiu:1.0,
									 imgurl: 'mng/roughness_map.jpg',
									 scene:true
								   };

						var lines=[
									{x: -550,
									 y: 120,
									 z: -450
									},
									{x: -550,
									 y: 120,
									 z: 330
									},
									{x: 180,
									 y: 120,
									 z: 330
									},
									{x: 180,
									 y: 120,
									 z: -100
									},
								 ];
						p3DObj.dynamicPath(vInfo,lines);

					}  else {
						p3DObj.stopDynamicPath(vname);
					}

					pstation.mperson=!pstation.mperson;

                }
            },
			      {
                btnid: "btn_alarm",
                btnTitle: "报警管理",
                btnimg: "./mng/alarm.png",
                event: function () {
                	//alert("报警管理");
					var valarmanme='equipment_card_52_alarm';
					var errorobj={
						name:valarmanme,
						size:{x:32,y:32},
						position:{x:0,y:70,z:0},
						imgurl: './mng/down.png'
					 };

					if(pstation.malarm) {
						//p3DObj.commonFunc.setSkinColor("cabinet1_1_door_01",0x000000);
						//p3DObj.commonFunc.setSkinColor("cabinet1_1_shell",0x000000);
						p3DObj.commonFunc.setSkinColor("equipment_card_52",0x000000);
						//p3DObj.commonFunc.makeTest("equipment_card_3",null);
						p3DObj.delSenceObject(valarmanme,false);
					}  else {
						//p3DObj.commonFunc.setSkinColor("cabinet1_1_door_01",0xff0000);
						//p3DObj.commonFunc.setSkinColor("cabinet1_1_shell",0xff0000);
						p3DObj.commonFunc.setSkinColor("equipment_card_52",0xff0000);
						p3DObj.commonFunc.addIdentification("equipment_card_52",errorobj);
					}

					pstation.malarm=!pstation.malarm;

                }
            },
        ]
    }

	pstation.malarm=false;
	pstation.mconnection=false;
	pstation.mpower=false;
	pstation.msecurity=false;
	pstation.mair=false;
	pstation.msmoke=false;
	pstation.mspace=false;
	pstation.musage=false;
	pstation.mperson=false;
	pstation.mwater=false;
    //复制机柜
	var icolum=14;
    for (var i = 1; i <=5;i++){
		if(i>2) icolum=10;
        for (var j = 1; j <=icolum; j++) {
            if (i != 1 || j != 1) {
            Aobjects.objects.push({
                show: true,
                copyfrom: 'cabinet1_1',
                name: 'cabinet'+i+'_'+j,
                childrenname: ['cabinet' + i + '_' + j + '_shell', 'cabinet' + i + '_' + j + '_door_01'],
                uuid: '',
                objType: 'cloneObj',
                position: { x:-(i-1)*200, y:0 , z:(j-1)*73 },
                scale: { x: 1, y: 1, z: 1 }
            });
            }
        }
    }
    pstation.initp3D('canvas-frame', initOption, Aobjects);
    pstation.start();
}
function opcabinetdoor(_obj) {
    var doorstate = "close";
    var tempobj = null;
    if (_obj.doorState != null && typeof (_obj.doorState) != 'undefined') {
        doorstate = _obj.doorState;
        tempobj = _obj.parent;
    } else {
        console.log("add parent");
        var _objparent = _obj.parent;
        tempobj = new THREE.Object3D();
        tempobj.position.set(_obj.position.x, _obj.position.y, _obj.position.z + _obj.geometry.parameters.depth / 2);
        _obj.position.set(0, 0, -_obj.geometry.parameters.depth / 2);
        tempobj.add(_obj);
        _objparent.add(tempobj);
    }
    _obj.doorState = (doorstate == "close" ? "open" : "close");
    new TWEEN.Tween(tempobj.rotation).to({
        y: (doorstate == "close" ? 0.25 * 2 * Math.PI : 0 * 2 * Math.PI)
    }, 1000).start();
}
function openRightDoor(_obj,func) {
    var doorstate = "close";
    var tempobj = null;
    if (_obj.doorState != null && typeof (_obj.doorState) != 'undefined') {
        doorstate = _obj.doorState;
        tempobj = _obj.parent;
    } else {
        console.log("add parent");
        var _objparent = _obj.parent;
        tempobj = new THREE.Object3D();
        tempobj.position.set(_obj.position.x - _obj.geometry.parameters.width / 2, _obj.position.y, _obj.position.z);
        _obj.position.set(_obj.geometry.parameters.width / 2, 0, 0);
        tempobj.add(_obj);
        _objparent.add(tempobj);
    }
    _obj.doorState = (doorstate == "close" ? "open" : "close");
    new TWEEN.Tween(tempobj.rotation).to({
        y: (doorstate == "close" ? 0.25 * 2 * Math.PI : 0 * 2 * Math.PI)
    }, 10000).easing(TWEEN.Easing.Elastic.Out).onComplete(func()).start();
}
function showDiv(popupdiv,bShade,bMove,imouse,objs)
{
	var Idiv=document.getElementById(popupdiv);
	Idiv.style.display="block";
	//var vx=imouse.clientX+"px";
	//var vy=imouse.clientY+"px";
	var vx=(document.documentElement.clientWidth-Idiv.clientWidth)/2+document.documentElement.scrollLeft+"px";
	var vy=(document.documentElement.clientHeight-Idiv.clientHeight)/2+document.documentElement.scrollTop-50+"px";
	//alert(imouse.clientX+"-"+imouse.clientY+"**");
	/**/
	var vdiv=$("#" + popupdiv);
    if (objs != null && objs.length > 0) {
		vdiv.empty();
		var $title=$('<div id="title" onclick="closeDiv(\'' + popupdiv + '\')">实时数据</div>');
		vdiv.append($title);
		$title.append('<div id="ten" onclick="closeDiv(\'' + popupdiv + '\')"></div>');
		$title.append('<div id="img" title="关闭" onclick="closeDiv(\'' + popupdiv + '\')" ></div>');
		var $content=$('<div id="content">');
		vdiv.append($content);
         $.each(objs, function (index,_obj) {
             $content.append(' <div style="float:center"><div class="divitem">' + _obj.name + '</div><input type="text" id="' + _obj.id + '" value="' + _obj.value + '" /></div>');
         });
     }

	//以下部分要将弹出层居中显示
	Idiv.style.left=vx;
	Idiv.style.top=vy;
	//以下部分使整个页面至灰不可点击
	if(true==bShade) {
		var procbg = document.createElement("div"); //首先创建一个div
		procbg.setAttribute("id","mybg"); //定义该div的id
		procbg.style.background = "#000000";
		procbg.style.width = "100%";
		procbg.style.height = "100%";
		procbg.style.position = "fixed";
		procbg.style.top = "0";
		procbg.style.left = "0";
		procbg.style.zIndex = "500";
		procbg.style.opacity = "0.6";
		procbg.style.filter = "Alpha(opacity=70)";
		//以上部分也可以用csstext代替
		// procbg.style.cssText="background:#000000;width:100%;height:100%;position:fixed;top:0;left:0;zIndex:500;opacity:0.6;filter:Alpha(opacity=70);";
		//背景层加入页面
		document.body.appendChild(procbg);
	}
	document.body.style.overflow = "hidden"; //取消滚动条
	//以下部分实现弹出层的拖拽效果
	if(true==bMove) {
		var posX;
		var posY;
		Idiv.onmousedown=function(e)
		{
			if(!e) e = window.event; //IE
			posX = e.clientX - parseInt(Idiv.style.left);
			posY = e.clientY - parseInt(Idiv.style.top);
			document.onmousemove = mousemove;
		}
		document.onmouseup = function()
		{
			document.onmousemove = null;
		}
		function mousemove(ev)
		{
			if(ev==null) ev = window.event;//IE
			Idiv.style.left = (ev.clientX - posX) + "px";
			Idiv.style.top = (ev.clientY - posY) + "px";
		}
	}
}
function closeDiv(popupdiv) //关闭弹出层
{
	var Idiv=document.getElementById(popupdiv);
	Idiv.style.display="none";
	//document.body.style.overflow = "auto"; //恢复页面滚动条

	var mybg = document.getElementById("mybg");
	if(mybg != null) {
		var body = document.getElementsByTagName("body");
		body[0].removeChild(mybg);
	}
}
function showVideoDiv(popupdiv,bShade,bMove,imouse,objs)
{
	var Idiv=document.getElementById(popupdiv);
	Idiv.style.display="block";
	//var vx=imouse.clientX+"px";
	//var vy=imouse.clientY+"px";
	var vx=(document.documentElement.clientWidth-Idiv.clientWidth)/2+document.documentElement.scrollLeft+"px";
	var vy=(document.documentElement.clientHeight-Idiv.clientHeight)/2+document.documentElement.scrollTop-50+"px";
	//alert(imouse.clientX+"-"+imouse.clientY+"**");
	/**/
	var vdiv=$("#" + popupdiv);
    //if (objs != null && objs.length > 0)
	{
		vdiv.empty();
		var $title=$('<div id="vtitle" onclick="closeVideoDiv(\'' + popupdiv + '\')">视频监控</div>');
		vdiv.append($title);
		$title.append('<div id="ten" onclick="closeVideoDiv(\'' + popupdiv + '\')"></div>');
		$title.append('<div id="img" title="关闭" onclick="closeVideoDiv(\'' + popupdiv + '\')" ></div>');
		var $content=$('<div id="vcontent">');
		vdiv.append($content);

		//$content.append(' <video id="video" autoplay loop webkit-playsinline style="width:100%;height:100%;"> <source src="sintel.mp4" type=\'video/mp4; codecs="avc1.42E01E, mp4a.40.2"\'>		</video>');
		//$content.append(' <iframe src="http://easynvr.easydarwin.org:10800/play.html?channel=10" width="100%" height="100%" scrolling="yes" />');
		$content.append(' <iframe src="sintel.mp4" width="100%" height="100%" scrolling="yes" />');
     }

	//以下部分要将弹出层居中显示
	Idiv.style.left=vx;
	Idiv.style.top=vy;
	//以下部分使整个页面至灰不可点击
	if(true==bShade) {
		var procbg = document.createElement("div"); //首先创建一个div
		procbg.setAttribute("id","mybg"); //定义该div的id
		procbg.style.background = "#000000";
		procbg.style.width = "100%";
		procbg.style.height = "100%";
		procbg.style.position = "fixed";
		procbg.style.top = "0";
		procbg.style.left = "0";
		procbg.style.zIndex = "500";
		procbg.style.opacity = "0.6";
		procbg.style.filter = "Alpha(opacity=70)";
		//以上部分也可以用csstext代替
		// procbg.style.cssText="background:#000000;width:100%;height:100%;position:fixed;top:0;left:0;zIndex:500;opacity:0.6;filter:Alpha(opacity=70);";
		//背景层加入页面
		document.body.appendChild(procbg);
	}
	document.body.style.overflow = "hidden"; //取消滚动条
	//以下部分实现弹出层的拖拽效果
	if(true==bMove) {
		var posX;
		var posY;
		Idiv.onmousedown=function(e)
		{
			if(!e) e = window.event; //IE
			posX = e.clientX - parseInt(Idiv.style.left);
			posY = e.clientY - parseInt(Idiv.style.top);
			document.onmousemove = mousemove;
		}
		document.onmouseup = function()
		{
			document.onmousemove = null;
		}
		function mousemove(ev)
		{
			if(ev==null) ev = window.event;//IE
			Idiv.style.left = (ev.clientX - posX) + "px";
			Idiv.style.top = (ev.clientY - posY) + "px";
		}
	}
}
function closeVideoDiv(popupdiv) //关闭弹出层
{
	var Idiv=document.getElementById(popupdiv);
	Idiv.style.display="none";
	//document.body.style.overflow = "auto"; //恢复页面滚动条

	//var vdiv=$("#video");
	//var vdiv=document.getElementById("video");
	//vdiv.pause();

	var mybg = document.getElementById("mybg");
	if(mybg != null) {
		var body = document.getElementsByTagName("body");
		body[0].removeChild(mybg);
	}
}
function updateDivItem(popupdiv,objitems) //update
{
	var vpopupdiv=$("#" + popupdiv);
	if (vpopupdiv == null)
		return ;

	if (objitems != null && objitems.length > 0) {
         $.each(objitems, function (index,_obj) {
			 var v1=$("#" + _obj.id);
			 if (v1 != null)
				v1.attr("value",_obj.value);
         });
     }
}

var t1=0;
var max=367;
var min=184;
function updateDivItemVaule() //
{
	var objitems=[
		{id:'upbw',
		 value: Math.floor(Math.random()*(max-min+1)+min)
		},
		{id:'downbw',
		 value: Math.floor(Math.random()*(max-min+1)+min)
		}
	 ];
	updateDivItem('main2',objitems);

	 //var v1=$("#item1");
	 //v1.attr("value",'test');
	 //var element = document.getElementById('devname');
	 //alert(element);
	 /*
	 		if(times>5)
			clearInterval(t1);
		times++;

	var tween = new TWEEN.Tween({ top: 84, left: 290 })
		.to({ top: 100, left: 300 }, 2000)
		.onUpdate(function() {

			//alert(this.top);
			//v1.attr("value",this.top);
			//element.style.top = this.top + 'px';
			//element.style.left = this.left + 'px';
			//element.value=this.top;
		}).start();
		*/
}

function DynamicPath2(mainCamera,lines,vindex) {
	 if (lines.length > vindex ) {
		 var normal = new THREE.Vector3();
		 normal.x=normal.y=normal.z=0.01;
		 mainCamera.matrix.lookAt( mainCamera.position, lines[vindex], normal );
		 //mainCamera.lookAt( lines[vindex] );
		 /*
		var tweenlookat=new TWEEN.Tween(mainCamera.position).to({
			x:lines[vindex].x, y:lines[vindex].y, z:lines[vindex].z,
		}, 5000).onComplete(function () {
			DynamicPath(mainCamera,lines,vindex+1);
		}).start();
		 */
		var tween=new TWEEN.Tween(mainCamera.position).to({
			x:lines[vindex].x, y:lines[vindex].y, z:lines[vindex].z,
		}, 5000).onComplete(function () {
			DynamicPath(mainCamera,lines,vindex+1);
		}).start();
	 }
 }
